package chu.dejian.models;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

import chu.dejian.entity.RecordEntity;

/**
 * Created by Administrator on 2015/12/18 0018.
 */
public class PostMeasurementRequest {

    /**
     * device_model : 1
     * device_type : 1
     * device_sub_type : 1
     * time : 423124234
     * timezone_offset : 8
     * result : {"systolic":126,"diastolic":78,"pulse":65,"message":"Blood pressure is normal. Pulse is normal","note":""}
     * location :
     */

    private int device_model;
    private int device_type;
    private int device_sub_type;
    private String time;
    private int timezone_offset;
    /**
     * systolic : 126
     * diastolic : 78
     * pulse : 65
     * "pulsestate":0,
     * message : Blood pressure is normal. Pulse is normal
     * note :
     */

    private ResultEntity result;
    private String location;

    public PostMeasurementRequest(RecordEntity recordEntity,double latitude, double longitude){
        device_model = 1;
        device_type = 1;
        device_sub_type = 1;
        time = recordEntity.dateTime;
        timezone_offset = 480;
        result = new ResultEntity(recordEntity.systolic,recordEntity.diastolic,recordEntity.pulse,
                recordEntity.message,recordEntity.note,recordEntity.pulseState);
        location = latitude + "," + longitude;
    }

    public void setDevice_model(int device_model) {
        this.device_model = device_model;
    }

    public void setDevice_type(int device_type) {
        this.device_type = device_type;
    }

    public void setDevice_sub_type(int device_sub_type) {
        this.device_sub_type = device_sub_type;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public void setTimezone_offset(int timezone_offset) {
        this.timezone_offset = timezone_offset;
    }

    public void setResult(ResultEntity result) {
        this.result = result;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public int getDevice_model() {
        return device_model;
    }

    public int getDevice_type() {
        return device_type;
    }

    public int getDevice_sub_type() {
        return device_sub_type;
    }

    public String getTime() {
        return time;
    }

    public int getTimezone_offset() {
        return timezone_offset;
    }

    public ResultEntity getResult() {
        return result;
    }

    public String getLocation() {
        return location;
    }

    public static class ResultEntity {
        private int systolic;
        private int diastolic;
        private int pulse;
        private String message;
        private String note;
        private int pulsestate;

        public ResultEntity(int systolic, int diastolic, int pulse,String message,String note,int pulsestate){
            this.systolic = systolic;
            this.diastolic = diastolic;
            this.pulse = pulse;
            this.message = message;
            this.note = note;
            this.pulsestate = pulsestate;
        }

        public int getPulsestate() {
            return pulsestate;
        }

        public void setPulsestate(int pulsestate) {
            this.pulsestate = pulsestate;
        }

        public void setSystolic(int systolic) {
            this.systolic = systolic;
        }

        public void setDiastolic(int diastolic) {
            this.diastolic = diastolic;
        }

        public void setPulse(int pulse) {
            this.pulse = pulse;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public void setNote(String note) {
            this.note = note;
        }

        public int getSystolic() {
            return systolic;
        }

        public int getDiastolic() {
            return diastolic;
        }

        public int getPulse() {
            return pulse;
        }

        public String getMessage() {
            return message;
        }

        public String getNote() {
            return note;
        }
    }
}
